package com.yang.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.yang.common.CommonDAO;
import com.yang.dao.MemberDAO;
import com.yang.vo.MemberInfoVO;

@Repository("MemberDAOImpl")
public class MemberDAOImpl extends CommonDAO implements MemberDAO{

	public List<Map<String, String>> getMemberListByKeyword(String keyword) throws SQLException {
		
		return sqlMapClient.queryForList("member.getMemberListByKeyword", keyword);
	}
	
	public List<Map<String, String>> getMemberListByDeptId(String deptId) throws SQLException {
		
		return sqlMapClient.queryForList("member.getMemberListByDeptId", deptId);
	}

	public Map<String, String> getMemberInfo(String memberId)
			throws SQLException {
		
		return (Map<String, String>) sqlMapClient.queryForObject("member.getMemberInfo", memberId);
	}

	public List<Map<String, String>> getPostionList(String companyId) throws SQLException {
		
		return sqlMapClient.queryForList("member.getPositionList", companyId);
	}

	public int getMemberSeqNo() throws SQLException{
		
		return (Integer) sqlMapClient.queryForObject("member.getMemberSeqNo");
	}
	
	public void insertMember(MemberInfoVO vo) throws SQLException {
		
		sqlMapClient.insert("member.insertMemberInfo", vo);
	}

	public List<Map<String, String>> selectMemberDatas(String companyId)
			throws SQLException {
		return sqlMapClient.queryForList("member.selectMemberDatas", companyId);
	}
}
